package DataModel
{
	public class PayStation
	{
		//
		// Key fields
		//
		private var m_strMinstryId:String;
		private var m_strDeptCode:String;
		private var m_strPayStationCode:String;
		
		//
		// Data Fields
		//
 		private var m_strPayStationDesc:String;
		private var m_strRegionCode:String;
		private var m_strProvinceCode:String;
		private var m_strDistrictCode:String;

		public function PayStation(	strMinstryId:String, 
									strDeptCode:String,
									strPayStationCode:String,
									strPayStationDesc:String,
									strRegionCode:String,
									strProvinceCode:String,
									strDistrictCode:String):void
		{
			m_strMinstryId = strMinstryId.toUpperCase();
			m_strDeptCode = strDeptCode.toUpperCase();
			m_strPayStationCode = strPayStationCode.toUpperCase();
 			m_strPayStationDesc = strPayStationDesc;
			m_strRegionCode = strRegionCode;
			m_strProvinceCode = strProvinceCode;
			m_strDistrictCode = strDistrictCode;
		}
		
		static public function makeKey(strMinistryId:String, strDepartmentCode:String, strPayStationCode:String):String
		{
			var key:XML = 
				<PayStationKey>
					<MinistryId/>
					<DepartmentCode/>
					<PayStationCode/>
				</PayStationKey>;
			key.MinistryId = strMinistryId;
			key.DepartmentCode = strDepartmentCode;
			key.PayStationCode = strPayStationCode;
			XML.prettyPrinting = false;
			var strKey:String = key.toXMLString();
			XML.prettyPrinting = true;
			return strKey;
		}

		public function get xmlKey():String
		{
			return makeKey(m_strMinstryId, m_strDeptCode, m_strPayStationCode);					
		}
		
		public function get ministryId():String
		{
			return m_strMinstryId;
		}

		public function get deptCode():String
		{
			return m_strDeptCode;
		}

		public function get payStationCode():String
		{
			return m_strPayStationCode;
		}

		public function get payStationDesc():String
		{
			return m_strPayStationDesc;
		}

		public function get regionCode():String
		{
			return m_strRegionCode;
		}

		public function get provinceCode():String
		{
			return m_strProvinceCode;
		}

		public function get districtCode():String
		{
			return m_strDistrictCode;
		}
	}
}